using System;
using System.Net;
using System.IO;

public static class CycleService
{
    public static void GetCycles(string baseUrl, string appkey, string token)
    {
        string url = $"{baseUrl.Trim()}/supplier-openapi/cycle/get.lf?appkey={Uri.EscapeDataString(appkey)}&token={Uri.EscapeDataString(token)}";
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
        request.Method = "GET";

        try
        {
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
            {
                string result = reader.ReadToEnd();
                Console.WriteLine("供货周期获取结果返回：");
                Console.WriteLine(result);
            }
        }
        catch (WebException e)
        {
            Console.WriteLine("发生错误：");
            Console.WriteLine(e.Message);
        }
    }
}